<%@ page contentType="text/html;charset=UTF-8" %>
		<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
		<html>
		<head>
			<title>字典管理</title>
			<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
			<meta name="decorator" content="default" />
			<%@ include file="/WEB-INF/views/include/bootstrap-table.jsp"%>
			
			<style type="text/css">
				.date-field-class{
				  width: 150px;
				}
			</style>
		</head>
		
		<body class="console-frame-body">
			<div class="layui-fluid">
				<div class="layui-row">
					<blockquote class="layui-elem-quote news_search">
					 <form id="searchForm">
						<sys:message content="${message}"/>
						<div class="layui-form-item">
							<label class="layui-form-label">类型</label>
                            <div class="layui-input-inline">
                                <input id="type" class="layui-input" type="text">
                            </div>
                             <label class="layui-form-label">描述</label>
                            <div class="layui-input-inline">
                                <input id="description" class="layui-input" type="text">
                            </div>
                            
							  <a id="btn_search" class="layui-btn search_btn">查询</a>
							  <a id="btn_reset" onclick="formResetBySearch();" class="layui-btn layui-btn-primary search_btn">重置</a>
						</div>
						
						
					  </form>
					</blockquote>
					 
				  <div id="toolbar">
						  <div class="layui-btn-group">
								  <button type="button" class="layui-btn layui-btn-normal" onclick="gotoView('${ctx}/sys/dict/form');">新增</button>
								  <button type="button" class="layui-btn layui-btn-danger" onclick="batchDelete('sys/dict/batchDelete')">批量删除</button>
						  </div>
					</div>
					
					<table id="table" 
				         data-toggle="table" 
				         data-url="${ctx}/sys/dict/dictListJson"
				         data-toolbar="#toolbar"
					     data-maintain-selected="true" 
					     data-side-pagination="server"
					     data-click-to-select="true" 
					     data-pagination="true" 
					     data-single-select="false"
					     data-id-field="id"
					     data-query-params="doQuery"
					     data-method="get"
					     data-cache="false"
					     data-show-columns="true"
					     data-page-list="${dataPageList}">
						<thead>
							<tr>
								<!-- data-sortable="true" 排序 -->
							    <!-- data-visible="false" 可以隐藏列 -->
								<th data-checkbox="true"></th>
								<th data-field="id" data-formatter="operationFormatter" class="date-field-class">操作</th>
								<th data-field="value">键值</th>
								<th data-field="label">标签</th>
								<th data-field="type">类型</th>
								<th data-field="description">描述</th>
								<th data-field="sort">排序</th>
								<!-- data-sortable="true" 排序 -->
								<!-- data-visible="false" 可以隐藏列 -->
								
							</tr>
						</thead>
					</table>
				</div>
			</div>
			
			<script type="text/javascript">
			var $table = $('#table');
			$(function () { 
			    $("#btn_search").click(function () { 
			    	$table.bootstrapTable('refresh'); 
			    }); 
			}); 
			  
			//查询函数
			  function doQuery(params) {
				  params.searchType = "${param.type}";						
				  params.type = $("#type").val();
				  params.description = $("#description").val();
				  return params;
			  }
			
			/**
			*  操作项  add for lgx  提供查看，修改，删除按钮，如果还有系统按钮，
			*  比如禁用，可在子页面进行自定义函数添加（建议列表操作项按钮不要超过5个）
			*/
			function operationFormatter(value, row){
				var params = "id="+value;
				//修改
				var html =  '<a href="javascript:void(0);" class="layui-btn layui-btn-xs" style="padding-right:5px;" onclick="modify(\'sys/dict/form\',\'修改字典\',\''+params+'\')">修改</a>';
	
				//删除
				html= html +'<a href="javascript:void(0);" class="layui-btn layui-btn-danger layui-btn-xs" onclick="deleteData(\'sys/dict/deleteAjax\',\'是否删除数据？\',\''+params+'\')">删除</a>';
				
				return html;
			} 
			
			
			function typeFormatter(value, row){
				   var data = ${fns:getDictListJson('cms_isRelease')}; 
				   value = getDictLabel(data,value,'-');
				   return value;
			}
			</script>
			
			<jsp:include page="/WEB-INF/views/include/pageJs.jsp" />
		</body>
		
		</html>